package com.mybatis.crudservice.service.impl;

import java.util.Map;
import com.mybatis.crudservice.dao.EntityDao;
import com.mybatis.crudservice.service.EntityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @ 描 述 :
 * @ 作 者 : 一念〃
 * @ 时 间 : 10:28 2019/6/7
 * @ 备 注 :
 */
@Service
public class EntityServiceImpl implements EntityService {

    @Autowired
    private EntityDao entityDao;

    /**
     * 新增 - 返回受影响行数
     * @param entity
     * @return
     */
    @Override
    @Transactional
    public int insertReCount(String entity, Map<String, Object> params) throws Exception{
        return entityDao.insertReCount(entity,params);
    }

    /**
     * 修改 - 返回受影响行数
     * @param params
     * @return
     */
    @Override
    @Transactional
    public int updateReCount(String entity, Map<String, Object> params) throws Exception {
        return entityDao.updateReCount(entity,params);
    }
}
